home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLUT / FAQ.glut < prev    next >
Text File  |  1996-11-11  |  12KB  |  334 lines

  1.  
  2. Here are few questions I expect to be frequently asked about GLUT 3.0.
  3. First, here are tag-line summaries of the question subject matter.
  4.  
  5. Q1:   Problems building GLUT.
  6. Q2:   More GUI features.
  7. Q3:   New with GLUT 3.0.
  8. Q4:   GLUT for NT.
  9. Q5:   GLUT for OS/2.
  10. Q6:   GLUT for Power Mcintosh.
  11. Q7:   GLUT 3.0 incompatibilities.
  12. Q8:   GLUT and Motif.
  13. Q9:   aux convension to GLUT.
  14. Q10:  SGI N32 and 64-bit support.
  15. Q11:  FORTRAN and GLUT.
  16. Q12:  Sophisticated input devices.
  17. Q13:  GLUT and Open Inventor.
  18. Q14:  GLUT, Sun, and Overlays.
  19. Q15:  The GLUT stroke font.
  20. Q16:  My upcoming book.
  21. Q17:  GLUT and Microsoft portability.
  22. Q18:  GLUT and networking.
  23. Q19:  Asking GLUT questions.
  24. Q20:  Free OpenGL.
  25. Q21:  GLUT overlay example code.
  26. Q22:  BadMatch errors running GLUT programs. 
  27. Q23:  New in GLUT 3.1.
  28.  
  29. --
  30.  
  31. Q1:  I've tried to use the "mkmkfiles.imake" script to generate
  32.      Makefiles so I can build GLUT, but it doesn't seem to work.
  33.  
  34. A1:  While Imakefiles are supposted to be system independent (hence
  35.      the "I"), the commands to translate Imakefiles into Makefiles
  36.      varies from system to system.  The X Consortium provides a command
  37.      called "xmkmf", but vendors do not put this command in a
  38.      consistent place.  The "mkmkfiles.imake" script tries its best to
  39.      generate Makefiles, but may get confused by different vendors
  40.      configurations that I am not aware of.
  41.  
  42.      It is also possible the imake configuration files (typically
  43.      located at /usr/lib/X11/config) are buggy or from a very old
  44.      version of X.
  45.  
  46.      SGI users can benefit from using the "mkmkfile.sgi" script that
  47.      uses SGI's parallel make, though "mkmkfiles.imake" should work
  48.      too.
  49.  
  50. --
  51.  
  52. Q2:  GLUT needs improved menus, dialog boxes, scrollbars, text
  53.      entry fields, etc. to be useful to me?
  54.  
  55. A2:  GLUT does not pretend to be a full-featured graphical user
  56.      interface toolkit.
  57.  
  58.      You _could_ write these sorts of GUI objects using GLUT and OpenGL
  59.      if you needed to.  The other alternative is to use Motif or
  60.      whatever full featured toolkit you have.
  61.  
  62. --
  63.  
  64. Q3:  What new things are in GLUT 3.0?
  65.  
  66. A3:  See README.glut3 or read The OpenGL Utility (GLUT) Programming
  67.      Interface document.
  68.  
  69. --
  70.  
  71. Q4:  Is there a version of GLUT for Windows NT or Windows 95.
  72.  
  73. A4:  Nate Robbins at Evans & Sutherland has been working on a
  74.      freely distributable version of GLUT.  His efforts are directed at
  75.      porting GLUT 2.3.
  76.  
  77. --
  78.  
  79. Q5:  Is there a version of GLUT for OS/2?
  80.  
  81. A5:  Yes.  I believe a version based on GLUT 2.x is distributed on an
  82.      OS/2 OpenGL developer's CD-ROM.
  83.  
  84. --
  85.  
  86. Q6:  Is there a version of GLUT for the Power Mcintosh?
  87.  
  88. A6:  Was told by Template Graphics that an incomplete version of
  89.      GLUT had been developed for their OpenGL product for the Power
  90.      Mcintosh.  I am not sure if it was ever completed or made
  91.      available.
  92.  
  93. --
  94.  
  95. Q7:  I'm hesitant about upgrading to GLUT 3.0 since I've got things
  96.      working will with GLUT 2.3.  Is the transition painful?
  97.  
  98. A7:  I do not believe so.  There are two changes worth noting that
  99.      _may_ affect programs you have written.
  100.  
  101.      First, you need a display callback registered before your display
  102.      your windows on the screen.  It did not make sense for this to not
  103.      be true.  In all likeihood, this should not affect your GLUT
  104.      programs if they written well.
  105.  
  106.      Second, you can no longer change, create, or destroy menus while
  107.      pop-up menus are in use.  Before, you could do this, but it meant
  108.      a menu might be changed while in use.  It was near impossible to
  109.      describe what should happen in the case of menus being changed
  110.      while in use that was likely to be portable to the way other
  111.      window systems handled menus, so I made the practice illegal.
  112.  
  113.      You can register a menu status callback to know when menus become
  114.      used and unused to avoid changing menus while they are in use.
  115.  
  116.      For more details about what has changed, see the CHANGES file.
  117.  
  118. --
  119.  
  120. Q8:  So how do I use GLUT and Motif together?
  121.  
  122. A8:  You don't.  To make GLUT simple and easy-to-program, GLUT
  123.      supplies its own event processing loop.  This makes it nearly
  124.      impossible to combine GLUT and Motif.  If you want Motif, you
  125.      probably want a full-featured toolkit, and you ship skip GLUT and
  126.      implement your application directly in Motif.
  127.  
  128. --
  129.  
  130. Q9:  I have a bunch of simple OpenGL programs using the aux toolkit
  131.      descibed in the OpenGL Programming Guide (the "red" book).  Is
  132.      there an easy way to convert them to GLUT?
  133.  
  134. A9:  In the progs/redbook directory, there is a script named
  135.      aux2glut.sed  It will give you a good start at converting simple
  136.      aux calls to their GLUT equivalents.  It is a good start, but
  137.      you'll still have to hand edit some things.
  138.  
  139.      Here's a usage example:
  140.  
  141.      sed -f aux2glut.sed < aux_prog. > glut_prog.c
  142.  
  143. --
  144.  
  145. Q10: I have IRIX 6.2 (or 6.1) and I'd like to write GLUT programs
  146.      run in true 64-bit and/or benefit from the recent, faster MIPS
  147.      processors.  How do I build GLUT to support these newer
  148.      application binary interfaces (ABIs)?
  149.  
  150. A10: See README.irix6
  151.  
  152. --
  153.  
  154. Q11: I'd like to write FORTRAN programs using GLUT and OpenGL.  How
  155.      do I use GLUT with FORTRAN?
  156.  
  157. A11: GLUT does have a FORTRAN language binding.
  158.  
  159.      For instructions for building a binding library for Silicon
  160.      Graphics workstations, see README.fortran
  161.  
  162. --
  163.  
  164. Q12: I'd like to use the sophisticated input devices that GLUT
  165.      supports.  What should I know about this?
  166.  
  167. A12: GLUT uses the X Input extension to talk to these devices.  Because
  168.      the X Input extension gives a framework for supporting input
  169.      devices, but does not manadate how particular devices are
  170.      supported, it is possible that each vendor supports the same input
  171.      devices differently.
  172.  
  173.      GLUT as implemented supports SGI's means of advertising the
  174.      tablet, dial & button box, and Spaceball devices.  I am not sure
  175.      how other vendors support these devices.  For the details of SGI's
  176.      support for these devices, see README.xinput  Since there is no
  177.      benefit in each vendor supporting these same devices in a
  178.      different an incompatible way, I encourage other vendors to
  179.      implement their devices in this same manner.
  180.  
  181. --
  182.  
  183. Q13: Can I use GLUT and Open Inventor?
  184.  
  185. A13: Yes.  See the README.inventor file.  Also, some source code
  186.      examples can be found at progs/inventor
  187.  
  188.      Because the Open Inventor development enviornment is not supported
  189.      on all systems, the Inventor example programs are not built by
  190.      default, and the Makefile there only support SGI systems.
  191.  
  192. --
  193.  
  194. Q14: I have Sun workstation, and it is supposed to support overlays.
  195.      So why does GLUT not use them?
  196.  
  197. A14: GLUT uses the SERVER_OVERLAY_VISUALS convention that advertises
  198.      overlay visuals.  Most major workstation vendors support this
  199.      convention (DEC, HP, IBM, SGI), but Sun does not.
  200.  
  201. --
  202.  
  203. Q15: The stroke font used for GLUT looks familar.  Where did it come
  204.      from?
  205.  
  206. A15: The data for the "stroke roman" font is lifted from the X11R5
  207.      PEX sample implementation.
  208.  
  209. --
  210.  
  211. Q16: I read in the NOTICE file that you are writing a book on
  212.      programming OpenGL for the X Window System.  When will it be
  213.      available?
  214.  
  215. A16: At SIGGRAPH '96 or possibly before that.
  216.  
  217. --
  218.  
  219. Q17: You mention an unnamed bu "very large window system software
  220.      vendor" as the reason portable GLUT programs should not directly
  221.      include <GL/gl.h> and <GL/glu.h> directly.  What's the vendor and
  222.      what are the details?
  223.  
  224. A17: Microsoft.  It's version of <GL/gl.h> requires <windows.h> to be
  225.      included before <GL/gl.h> can be included because of Microsoft
  226.      function declaration conventions.  Sigh.
  227.  
  228. --
  229.  
  230. Q18: I want my GLUT program to read and send information over a socket
  231.      to some other program.  How do I do this in in GLUT?
  232.  
  233. A18: You can not do it currently.  I am considering such support for
  234.      a possible GLUT 4.0.  I'd like to have a portable solution.
  235.  
  236.      What you'd like is a callback that would tell you when a socket is
  237.      ready for reading and writing.  I'm hoping to find a way to
  238.      support this in an operating system independent manner.  Does
  239.      anyone know of a good portable interface for networked bytestream
  240.      connections?
  241.  
  242.      For now, you've got the source code to GLUT and you could hack it
  243.      into GLUT for whatever particular interface your operating system
  244.      provides.
  245.  
  246. --
  247.  
  248. Q19: Where's the best place to ask questions about GLUT or OpenGL?  Can
  249.      I just email them to you?
  250.  
  251. A19: While I may try to return email if I have time, the best place
  252.      is the comp.graphics.api.opengl newsgroup.  This gives a lot more
  253.      people a chance to answer your question and you'll probably get an
  254.      answer much faster than sending me email.  Plus, I may not know
  255.      the answer though someone on the "net" may know it.
  256.  
  257. --
  258.  
  259. Q20: My workstation doesn't have OpenGL.  Where can I get a free copy
  260.      to use with GLUT?
  261.  
  262. A20: OpenGL is licensed by Silicon Graphics and is not available as
  263.      "free" or "public domain" software, but workstation vendors
  264.      typically bundle OpenGL software with their workstation.  However,
  265.      there is a package called Mesa written by Brian Paul at the
  266.      University of Wisconsin that implements the OpenGL API.  (To be
  267.      branded as "OpenGL", an implementation must be licensed _and_ pass
  268.      the Architectural Review Board's conformance suite, so Mesa is not
  269.      an official "OpenGL" implementation.)  Mesa does work with GLUT.
  270.  
  271. --
  272.  
  273. Q21: I hear GLUT 3.0 has overlay support.  Where is an example?
  274.  
  275. A21: Look at progs/examples/zoomdino.c for an example of using overlays
  276.      for rubber-banding and display of a help message, both in the
  277.      overlays.  Also, test/over_test.c exercises all of the overlay
  278.      routines.
  279.  
  280. --
  281.  
  282. Q22: I get BadMatch X protocol errors when I run GLUT programs. What gives?
  283.  
  284. A22: There is a bug in the Solaris 2.4 and 2.5 implementation of
  285. XmuLookupStandardColormap. When you compile GLUT on Solaris 2.4 or 2.5, please
  286. apply the following patch and compile with -DSOLARIS_2_4_BUG to workaround the
  287. problem. See the comment in the patch below.  This code is already in GLUT 3.1.
  288.  
  289. *** glut_win.c Wed Apr 24 14:06:08 1996
  290. --- glut_win.c.bad     Wed Apr 24 14:03:58 1996
  291. ***************
  292. *** 398,414 ****
  293.     case TrueColor:
  294.     case DirectColor:
  295.       *colormap = NULL;   /* NULL if RGBA */
  296. - #ifndef SOLARIS_2_4_BUG
  297. -     /* Solaris 2.4 has a bug in its XmuLookupStandardColormap
  298. -        implementation.  Please compile your Solaris 2.4 version 
  299. -        of GLUT with -DSOLARIS_2_4_BUG to work around this bug.
  300. -        The symptom of the bug is that programs will get a
  301. -        BadMatch error from X_CreateWindow when creating a GLUT
  302. -        window because Solaris 2.4 creates a  corrupted
  303. -        RGB_DEFAULT_MAP property.  Note that this workaround
  304. -        prevents Colormap sharing between applications, perhaps
  305. -        leading unnecessary colormap installations or colormap
  306. -        flashing. */
  307.       status = XmuLookupStandardColormap(__glutDisplay,
  308.         vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP,
  309.         /* replace */ False, /* retain */ True);
  310. --- 398,403 ----
  311. ***************
  312. *** 423,429 ****
  313.               return;
  314.             }
  315.       }
  316. - #endif
  317.       /* If no standard colormap but TrueColor, just make a
  318.          private one. */
  319.       /* XXX Should do a better job of internal sharing for
  320. --- 412,417 ----
  321.  
  322. --
  323.  
  324. Q23: What is new in GLUT 3.1?
  325.  
  326. A23: GLUT 3.1 is largely a maintence release.  There are some new programs, a
  327. few minor GLUT library bug fixes, but mostly GLUT 3.1 is to make sure GLUT
  328. builds cleanly on various platforms like SunOS, HP/UX, Solaris, and Linux.
  329. See the CHANGES file included in the distribution for more details.
  330.  
  331. --
  332.  
  333. - Mark
  334.